/**
 * 
 */
package edu.gtcfla.km.admin.appmodules.web;

import java.util.LinkedHashSet;

import net.sf.json.JSONArray;
import net.sf.json.JsonConfig;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.vsg.common.i18n.I18nMessageService;
import org.vsg.common.web.json.processor.JsDateViewJsonValueProcessor;
import org.vsg.module.resources.web.discover.ModuleDiscoveryService;

import edu.gtcfla.km.admin.appmodules.service.MenuResourceService;
import edu.gtcfla.km.admin.appmodules.service.RegisterResourceService;
import edu.gtcfla.km.admin.appmodules.service.UrlManagerService;

/**
 * @author Bill Vison
 *
 */
@Controller
@Lazy
@RequestMapping("/apps_sysadmin")
public class AdminDashboardController {

	
	private final static Logger logger = LoggerFactory.getLogger(AdminDashboardController.class);
	

	
	
	@Autowired(required=false)
	private I18nMessageService i18nMessageService;
			

	private String modulePrefix = "/apps_sysadmin/main";

	@RequestMapping(value = "/main/index.htm")
	public ModelAndView index() throws Exception {


		ModelAndView mav = new ModelAndView();
		mav.setViewName( modulePrefix + "/index"); // view name

		return mav;

	}	
	
	@RequestMapping(value = "/data/resource/sysadminsubmenu.json")
	public ModelAndView sysadminsubmenuTree()
			throws Exception {

		
		JsonConfig jcfg = new JsonConfig();	
		jcfg.registerJsonValueProcessor(java.util.Date.class,new JsDateViewJsonValueProcessor());
		JSONArray jsonObject = JSONArray.fromObject(new LinkedHashSet(), jcfg);		
		

		ModelAndView mav = new ModelAndView();
		mav.addObject("json", jsonObject);
		mav.setViewName("result"); // view name
        
		return mav;

	}	
	
}
